using UnityEngine;
using UnityEngine.UI;

[RequireComponent(typeof(Button))]
public abstract class MyButton : MonoBehaviour
{
    protected Button m_button;
    protected Text m_text;

    protected virtual void Awake()
    {
        m_button = GetComponent<Button>();
        m_text = GetComponentInChildren<Text>();
        m_button.onClick.AddListener(OnClick);
    }

    protected abstract void OnClick();
}
